#pragma once
#include "base/core/singleton.h"
#include "base/core/object_pool.h"
#include "Common/DuplicateDefine.h"
#include "Block.h"


class BlockMgr : public ManualSingleton<BlockMgr>
{
	friend class ManualSingleton < BlockMgr >;
public:
	BlockMgr();
	~BlockMgr();
	bool Init();
	void UnInit();
	IBlock *MakeBlockObj();
	void FreeBlockObj(IBlock *pBlock);
	bool RecycleBlock(IBlock *pBlock);
private:
	ObjectPool<Block> *m_pBlockPool;
};


#define g_MakeBlockMgr() (BlockMgr::Instance())
#define g_GetBlockMgr()  (BlockMgr::GetInstance())
#define g_DelBlockMgr()  (BlockMgr::Destroy())